<%@ Page Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeBehind="EditProfile.aspx.cs" Inherits="MusicmanWeb.USER.EditProfile" Title="Musicman Levi9 | Edit profile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">

<script type="text/javascript" language="javascript">

    function toggleEditPassword(checked) {
        document.getElementById('<%= OldPasswordTxt.ClientID %>').disabled = !checked;
        document.getElementById('<%= NewPasswordTxt.ClientID %>').disabled = !checked;
        document.getElementById('<%= NewPassword2Txt.ClientID %>').disabled = !checked; 
    }

</script>
<div class="shim column"></div>
<div class="page" id="register">
    <div id="content-right">
        <h3>Profile picture</h3>
        <hr />
		<img src="ProfilePicture.axd" class="profile-edit" onError="this.style.display = 'none';"/>
        <asp:FileUpload ID="profilePictureUpload" runat="server" />
        <asp:Label ID="PictureValidationErrors" runat="server" Visible="false" EnableViewState="false"/>
    </div>    
    <div id="sidebar">
        <h4>User stats</h4>
        <hr />
        <table>
            <tr>
                <td>
                    Last logged date
                </td>
                <td>
                  <asp:Label ID="LastLoggedLbl" runat="server"/>
                </td>
            </tr>
            <tr>
                <td>
                    Total web logs
                </td>
                <td style="text-align:right">
                  <asp:Label ID="WebLogsLbl" runat="server"/>
                </td>
            </tr>
            <tr>
                <td>
                    Total client logs
                </td>
                <td style="text-align:right">
                  <asp:Label ID="ClientLogsLbl" runat="server"/>
                </td>
            </tr>
            <tr>
                <td>
                    Total files
                </td>
                <td style="text-align:right">
                  <asp:Label ID="TotalFilesLbl" runat="server"/>
                </td>
            </tr> 
            <tr>
                <td>
                    Total traffic
                </td>
                <td style="text-align:right">
                  <asp:Label ID="TotalTrafficLbl" runat="server"/>
                </td>
            </tr>    
            <tr>
                <td colspan="2">
                    <a href='#' onclick="window.open('UserHistory.aspx', 'userhistory', ',width=500,height=440,menubar=no,breplace=yes').focus();">
                        Full download history 
                    </a>
                </td>
            </tr>                                                           
        </table>
    </div>
    <div id="content-left">
        <h3>User profile</h3>
        <hr />
        <table>
            <tr>
                <td style="text-align:right">
                    Emailaddress:
                </td>
                <td >
                    <asp:TextBox ID="EmailaddressTxt" Enabled="false" runat="server"/>
                </td>
            </tr>
            <tr>
                <td style="text-align:right">
                    Firstname:
                </td>
                <td >
                    <asp:TextBox ID="FirstnameTxt" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                        ControlToValidate="FirstnameTxt"
                        ValidationGroup="Editing">*</asp:RequiredFieldValidator>        
                </td>
            </tr> 
           <tr>
                <td style="text-align:right">
                    Lastname:
                </td>
                <td >
                    <asp:TextBox ID="LastNameTxt" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                        ControlToValidate="LastNameTxt"
                        ValidationGroup="Editing">*</asp:RequiredFieldValidator>        
                </td>
            </tr>
           <tr>
                <td style="text-align:right">
                    Sex:
                </td>
                <td>
                 <asp:RadioButtonList ID="PersonSex" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Text="M" Value="M"/>
                    <asp:ListItem Text="F" Value="F"/>
                 </asp:RadioButtonList>
                </td>
            </tr>
           <tr>
                <td style="text-align:right">
                    Receive mail:
                </td>
                <td >
                    <asp:CheckBox ID="MailRequestCB" runat="server" />
                </td>
            </tr>
            <tr>
                <td style="text-align:right">
                    Change password:
                </td>
                <td>
                    <input runat="server" id="changePasswordCb" 
                            type="checkbox" 
                            onclick="toggleEditPassword(this.checked)" />
                </td>
            </tr>
            <tr>
                <td style="text-align:right">
                    Old password:
                </td>
                <td style="text-align:left">
                    <asp:TextBox ID="OldPasswordTxt" Enabled="false" CausesValidation="true" runat="server" TextMode="password" ValidationGroup="Editing"/>
                </td>
            </tr>
            <tr>
                <td style="text-align:right">
                    New password:
                </td>
                <td >
                    <asp:TextBox ID="NewPasswordTxt" runat="server" Enabled="false" TextMode="password"/>
                </td>
            </tr>   
            <tr>
                <td style="text-align:right">
                    Retype password:
                </td>
                <td >
                    <asp:TextBox ID="NewPassword2Txt" runat="server" Enabled="false" TextMode="password"/>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Label ID="ValidationMessage" runat="server" Visible="false" EnableViewState="false"/>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:ImageButton ID="Update" runat="server" 
                        CssClass="button" SkinID="update"
                        CausesValidation="true" 
                        ValidationGroup="Editing"
                        OnCommand="Update_Button"/>
                </td>
            </tr>
        </table>
    </div>
    
    </div>
</asp:Content>
